{extend name="base" /}
{block name="js"}
<script src="__STATIC__/plugins//kindeditor/kindeditor.js?v={$v}" type="text/javascript" ></script>
<script src="__ADMIN__/articles/help.js?v={$v}" type="text/javascript"></script>
<script>
$(function () {
	{if condition="$object['articleId'] !=0 "}
	   WST.setValues({$object});
	{/if}
	$('#articleForm').validator({
	    fields: {
	    	articleTitle: {
	    		tip: "请输入标题",
	    		rule: '标题:required;length[~50];'
	    	},
	    	articleKey: {
	    		tip: "请输入SEO关键字",
	    		rule: 'SEO关键字:required;length[~100];'
	    	},
        articleDesc: {
          tip: "请输入SEO描述",
          rule: 'SEO描述:required;length[~200];'
        },
		    articleContent: {
	    		tip: "请输入内容",
	    		rule: '内容:required;'
	    	}
	    },
	    valid: function(form){
	    	var articleId = $('#articleId').val();
	    	toEdits(articleId,{$p});
	    }
	})
});
</script>
{/block}
{block name="main"}
<input type='hidden' id='articleId' value='{$object["articleId"]}'/>
<form id='articleForm' autocomplete="off">
<table class='wst-form wst-box-top '>
  <tr>
     <th width='150'>标题<font color='red'>*</font>：</th>
     <td><input type="text" id='articleTitle' name='articleTitle' maxLength='50' class='ipt' style='width:60%;'/></td>
  </tr>
   <tr>
      <th width='150'>是否显示<font color='red'>*</font>：</th>
      <td height='24' class="layui-form">
         <input type="checkbox" id="isShow" {if $object['isShow']==1}checked{/if} name="isShow" value="1" class="ipt" lay-skin="switch" lay-filter="isShow" lay-text="显示|隐藏">
      </td>
   </tr>
  <tr>
     <th width='150'>SEO关键字<font color='red'>*</font>：</th>
     <td><input type="text" id='articleKey' name='articleKey' maxLength='120' class='ipt' style='width:80%;'/></td>
  </tr>
  <tr>
     <th width='150'>SEO描述<font color='red'>*</font>：</th>
     <td><textarea id='articleDesc' name='articleDesc' maxLength='200' style='width:80%;height:80px;' class='ipt'></textarea></td>
  </tr>
   <tr>
       <th width='150'>内容<font color='red'>*</font>：</th>
       <td>
       	<textarea id='articleContent' name='articleContent' class="form-control ipt" style='width:80%;'></textarea>
       </td>
    </tr> 
    <tr>
          <th>排序号：</th>
          <td>
            <input type="text" id="catSort" class="ipt" maxLength="20"  value='{$object['catSort']}' />
          </td>
    </tr> 
    <tr>
       <td colspan='2' align='center'>
       	<button type="submit" class="btn btn-primary btn-mright" ><i class="fa fa-check"></i>保&nbsp;存</button> 
        <button type="button" class="btn" onclick="javascript:location.href='{:Url(\'admin/articles/help\',\'p=\'.$p)}'"><i class="fa fa-angle-double-left"></i>返&nbsp;回</button>
       </td>
    </tr>
</table>
 </form>
  <script>
$(function(){
  //编辑器
    KindEditor.ready(function(K) {
		editor1 = K.create('textarea[name="articleContent"]', {
			height:'500px',
      uploadJson : WST.conf.ROOT+'/admin/articles/editorUpload',
			allowFileManager : false,
			allowImageUpload : true,
      allowMediaUpload : false,
			items:[
			        'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
			        'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
			        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
			        'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
			        'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
			        'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|','image','media','table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
			        'anchor', 'link', 'unlink', '|', 'about'
			],
			afterBlur: function(){ this.sync(); }
		});
	});
});
</script>
{/block}